﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel;
using System.Configuration.Install;
using System.ServiceProcess;

namespace EricWillis.Pop2Ticket
{
    [RunInstaller(true)]
    public class WindowsServiceInstaller : Installer
    {
        public WindowsServiceInstaller()
        {
            // use InstallUtil to install this .NET service!
            // http://msdn.microsoft.com/en-us/library/50614e95(VS.80).aspx

            ServiceProcessInstaller serviceProcessInstaller = new ServiceProcessInstaller();
            ServiceInstaller serviceInstaller = new ServiceInstaller();

            serviceProcessInstaller.Account = ServiceAccount.LocalSystem;

            // service name (shows up in services.msc)
            // you can interact with the service from the command line via:
            //   net start pop2ticket
            // or
            //   net stop pop2ticket
            serviceInstaller.DisplayName = "Pop2Ticket";
            serviceInstaller.StartType = ServiceStartMode.Manual;
            serviceInstaller.ServiceName = "Pop2Ticket";

            this.Installers.Add(serviceProcessInstaller);
            this.Installers.Add(serviceInstaller);
        }
    }
}
